<?php

class Persion {
    public $name;
    private $age;

    public function __construct($name='',$age=0)
    {
        $this->name=$name;
        $this->age = $age;
    }
    public function sayAge(){
        return $this->age;
    }
    public function setAge($age=22){
        $this->age=$age;
    }
    public function getAge(){
        return $this->age;
    }
}

$lisi = new Persion('lisi',35);
$lisi->setAge(23);
echo $lisi->name.'<br>';
echo $lisi->getAge();